//
//  UILabel + Extension.swift
//  ydy_weibo
//
//  Created by 杨德勇 on 16/7/17.
//  Copyright © 2016年 杨德勇. All rights reserved.
//

import UIKit

extension UILabel{
    convenience init(title:String,fontSize:CGFloat,color:UIColor,margin:CGFloat = 0){
        self.init()
        text = title;
        textAlignment = NSTextAlignment.Center
        font = UIFont.systemFontOfSize(fontSize)
        textColor = color
        numberOfLines = 0
        if margin != 0 {
            preferredMaxLayoutWidth = screenW - 2 * margin
            textAlignment = .Left
        }
        sizeToFit()
    }
}

